#!/bin/ksh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
#  
#  
# Licensed Materials - Property of IBM 
#  
# (C) COPYRIGHT International Business Machines Corp. 2003,2004 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
#----------------------------------------------------------------------
# Module Name:	ctcasd_start
# Component:	ctsec
# Description:	Script invoked by the System Resource Controller (SRC)
#		to start the "ctcas" service.  The service itself is embodied in
#		the executable file /usr/sbin/rsct/bin/ctcasd.  This script
#		is used to detect any unique operating environment
#		characteristics for the current platform and invoke the
#		"ctcasd" binary in the appropriate manner for that platform.
#----------------------------------------------------------------------
# @(#)90    1.4 src/rsct/security/CAS/bin/ctcasd_start.sh, ctsec, rsct_rzauh, rzauh0438a 8/19/04 11:22:13

typeset	CTCASD_DAEMON
typeset CTCASD_OPTIONS

CTCASD_DAEMON="/usr/sbin/rsct/bin/ctcasd"
CTCASD_OPTIONS=""

#----------------------------------------------------------------------
# RedHat special processing: revert to the old pthread library
# 	for RH9: assume kernel level 2.2.5
# 	for RHES: assume kernel level 2.4.19
#
# SLES special processing: revert to the old pthread library
# 	for SLES9: assume kernel level 2.4.19
#
typeset	REDHAT_RELFILE
typeset	REDHAT_VERSION
typeset SUSE_RELFILE
typeset SUSE_VERSION

REDHAT_RELFILE="/etc/redhat-release"
REDHAT_VERSION="^Red Hat Linux release 9 (Shrike)$"
REDHAT_VERSION2="^Red Hat Enterprise Linux .* release 3 (.*)$"
SUSE_RELFILE="/etc/SuSE-release"
SUSE_VERSION="^SUSE LINUX Enterprise Server 9 (.*)$"

if [[ -f $REDHAT_RELFILE ]]
then
	# test for RedHat 9
	grep "$REDHAT_VERSION" $REDHAT_RELFILE > /dev/null 2>&1
	if (($? == 0))
	then
		export LD_ASSUME_KERNEL=2.2.5
	else
		# test for all versions of RedHat Enterprise editions
		grep "$REDHAT_VERSION2" $REDHAT_RELFILE > /dev/null 2>&1
		if (($? == 0))
		then
			export LD_ASSUME_KERNEL=2.4.19
		fi
	fi
elif [[ -f $SUSE_RELFILE ]]
then
	# test for SLES 9
	grep "$SUSE_VERSION" $SUSE_RELFILE > /dev/null 2>&1
	if (($? == 0))
	then
		export LD_ASSUME_KERNEL=2.4.19
	fi
fi

#
# End RedHat version 9 and SLES version 9 special processing
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# Start the service with the correct options
#----------------------------------------------------------------------
exec $CTCASD_DAEMON $CTCASD_OPTIONS

# NOTREACHED
